package csc.daonjpa.java.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
@RequestMapping(value="/login")
public class LoginController {

	@RequestMapping
	public String goLogin(Model model, @RequestParam(value="loginfail", required=false) String loginfail){
		if (loginfail != null) {
			model.addAttribute("loginfail", "Invalid. Wrong username or password");
		}
		return "login";
	}
}
